<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
    <div id="app">
      <my-com-a word2="123" ></my-com-a>
    </div>
</body>
<script src="./lib/vue.js"></script>
<script>

  Vue.component('MyComA', {
    props:{
      str: {
        type: Number,
        default: 1000
      },
      arr: {
        type: Array,
        // default(){
        //   return [1,2,3]
        // }
        default:function (params) {
          return [1,2,3]
        }
      },
      num: [Number, String],
      word: {
        type: String,
        required: true
      },
      word2: {
        type: String,
        validator(value){
          return value.startsWith("lagou")
        }
      }
    },
    template: `
      <div>
        {{str}}
        {{arr}}
        {{word}}
      </div>
    `,
    data(){
      return {

      }
    }
  })

  new Vue({
    el: "#app",
    data: {
      arr: [
        1,2,3,4
      ]
    }
  })
</script>
</html>